package com.qiang.work.test01;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.*;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;

public class Demo0201 {

    private static final Logger LOGGER = LoggerFactory.getLogger(Demo0201.class);

    public static void main(String[] args) throws IOException {
        ServerSocket ss = new ServerSocket(20000);
        /*Date date = new Date();
        SimpleDateFormat df = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
        String format = df.format(date);
        InetAddress inetAddress = ss.getInetAddress();
        String hostAddress = inetAddress.getHostAddress();*/
        //LOGGER.warn(format + hostAddress+"发送成功");


        while (true) {
            Socket accept = ss.accept();
            MyThread myThread = new MyThread(accept);
            Thread thread = new Thread(myThread);
            thread.start();
        }
    }
}
